package com.victualler.core.common.utils;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
 
public class FileUtil {
	/**
	 * 输出为文件
	 * @param beanFactory
	 * @throws IOException 
	 */
	public static void printToFile(String content ,String path,String fileName,String charset) throws IOException{
		new File(path).mkdirs();//创建文件夹
		File file = new File(path+fileName); //创建文件
		file.createNewFile();
		BufferedWriter write = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file),charset)); 
	     //写出到文件流
	    write.write(content);
	    write.flush();
	    write.close();
	    System.out.println("输出成功："+path+fileName+".java");
	}
	
	 
}
